<div class="content-box"><!-- start_chungloai Content Box -->
    <div class="content-box-header">
        <h3>Quản lý slide</h3>
        <ul class="content-box-tabs">
            <li><a href="#tab1" class="default-tab">Table</a></li> <!-- href must be unique and match the id of target div -->
            <li><a href="#tab2">Forms</a></li>
        </ul>
        <div class="clear"></div>
    </div> <!-- End .content-box-header -->
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
            <table id="stock-table" class="table table-bordered">
                <tbody>
                    <tr bgcolor="#9fe1e1" id="sort-row" data-base-url="" class="">
                        <th>STT</th>
                        <th data-model="User" id="user_display_name"><a href="">Ảnh</a></th>
                        <th data-model="User" id="user_display_name1"><a href="">Link slideshow</a></th>
                        <th data-model="User" id="user_display_name1"><a href="">Tiêu đề</a></th>
                        <th>Sửa/ Xóa</th>
                    </tr>
                <?php
                $sql5=mysql_query("SELECT * FROM `tbl_slide`");
                $stt=0;
                while($row5=mysql_fetch_array($sql5))
                {
                    
                    $stt++;
                ?>
                    <tr class="error" <?php if(($stt%2)==1){echo 'bgcolor="#f2f1f1"';}else{echo 'bgcolor="#fce3f0"';}?>>
                        <th><?php echo $stt;?></th>
                        <th><img src="../js/data1/images/<?php echo $row5['image'];?>" style="height:100px; width: 180px;" /></th>
                        <th><a href="index.php?page=slide&act=edit&id=<?php echo $row5['id'];?>"><?php echo $row5['link'];?></a></th>
                        <th><?php echo $row5['caption'];?></th>
                        <th>
                        <a href="index.php?page=slide&act=edit&id=<?php echo $row5['id'];?>" class="del"><img src="resources/images/icons/edit.png" width="15" /></a>
                        <a href="index.php?page=slide&del=<?php echo $row5['id'];?>"  onclick="return confirmSubmit()" class="del"><img src="resources/images/icons/del.png" width="15" /></a>                                    </th>
                    </tr>
                <?php
                }
                ?>
                </tbody>
            </table>
        </div> <!-- End #tab1 -->
         <?php

if(isset($_GET['del']))
{
?>
    <div class="del">
		<?php
        $sql6=mysql_query("DELETE FROM `tbl_slide` WHERE `id`='".$_GET['del']."'");
		if(isset($sql6))
		{
			
			header("refresh:0; index.php?page=slide");
		}else{
			?>
			<script>alert('Xóa thất bại ! ');</script>
            <?php
		}
		?>    	
    </div>
 <?php
}
 ?>
    </div> <!-- End .content-box-content -->
</div> <!-- End .content-box -->
<script LANGUAGE="JavaScript">
    function confirmSubmit()
    {
        var agree=confirm("Bạn có chắc chắn xóa không?");
        if (agree)
            return true ;
        else
            return false ;
    }
</script>